package com.uchedao.vehicledetection.utils;

import android.view.ViewGroup;

import com.uchedao.vehicledetection.inf.ICheckValueListener;

/**
 * 检测按钮输值辅助工具类
 * 
 * @author "叶晋"
 * 
 */
public class CheckValueUtil {

	/**
	 * 设置列表对话框按钮
	 * 
	 * @param viewGroup
	 *            父组件
	 * @param tvResId
	 *            对应的 textviewID
	 * @param btnResId
	 *            要设置的 buttonID
	 * @param arrayResId
	 *            对应的可选字符串数组值
	 * @param btnText
	 *            button的当前值
	 */
	public static void textBtnListener(ViewGroup viewGroup, int tvResId, int btnResId, int arrayResId, String btnText,
			ICheckValueListener listener) {
		new CheckTextBtnValue(viewGroup, tvResId, btnResId, arrayResId, btnText, listener);
	}

	/**
	 * 只监听是否显示星号
	 * 
	 * @param viewGroup
	 *            父组件
	 * @param tvResId
	 *            对应的 textviewID
	 * @param btnResId
	 *            要设置的 buttonID
	 */
	public static void textBtnListener(ViewGroup viewGroup, int tvResId, int btnResId, String text) {
		new CheckTextBtnValue(viewGroup, tvResId, btnResId, text);
	}

	/**
	 * 输入框监听
	 * 
	 * @param viewGroup
	 * @param etResId
	 * @param text
	 * @param listener
	 */
	public static void editListener(ViewGroup viewGroup, int etResId, String text, ICheckValueListener listener) {
		new CheckTextEditValue(viewGroup, etResId, text, listener);
	}

	/**
	 * 输入框监听
	 * 
	 * @param viewGroup
	 * @param etResId
	 * @param text
	 * @param listener
	 */
	public static void textEditListener(ViewGroup viewGroup, int tvResId, int etResId, String text,
			ICheckValueListener listener) {
		new CheckTextEditValue(viewGroup, tvResId, etResId, text, listener);
	}

	/**
	 * 输入框监听
	 * 
	 * @param viewGroup
	 * @param etResId
	 * @param text
	 * @param listener
	 */
	public static void textEditListener(ViewGroup viewGroup, int tvResId, int etResId, String text, int etResId2,
			String text2, ICheckValueListener listener) {
		new CheckTextEditValue(viewGroup, tvResId, etResId, text, etResId2, text2, listener);
	}

	/**
	 * 日期选择框监听
	 * 
	 * @param type
	 * @param viewGroup
	 * @param tvResId
	 * @param btnResId
	 * @param text
	 * @param listener
	 */
	public static void textDateBtnListener(int type, ViewGroup viewGroup, int tvResId, int btnResId, String text,
			ICheckValueListener listener) {
		new CheckTextDateBtnValue(type, viewGroup, tvResId, btnResId, text, listener);
	}

	/**
	 * 日期选择框监听
	 * 
	 * @param type
	 * @param dateType
	 * @param viewGroup
	 * @param tvResId
	 * @param btnResId
	 * @param text
	 * @param listener
	 */
	public static void textDateBtnListener(int type, int dateType, ViewGroup viewGroup, int tvResId, int btnResId,
			String text, ICheckValueListener listener) {
		new CheckTextDateBtnValue(type, dateType, viewGroup, tvResId, btnResId, text, listener);
	}
}
